package com.touchealth.test.time;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;

import java.util.Date;

/**
 * @author zhangyanqiang
 * @date 2021/4/25
 **/
public class TimeInterval {


    public static void main(String[] args) throws InterruptedException {

//        Instant now = Instant.now();
//
//        Thread.sleep(1000);
//
//        System.out.print(ChronoUnit.MILLIS.between(now,Instant.now()));


         Date to = DateUtil.date();

         Date from = DateUtil.offset(to,DateField.HOUR,-1);

         System.out.println(to);

         System.out.println(from);




    }
}
